#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright @ 2014 OPS, Qunar Inc. (qunar.com)
#
# Author: tingfang.bao <tingfang.bao@qunar.com>
# DateTime: 15-3-10 下午5:38
from flask import Flask
from werkzeug.wsgi import SharedDataMiddleware

app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = 'uploads'

# 可以下载文件夹中文件了GET http://127.0.0.1:5000/uploads/data.csv
app.add_url_rule('/uploads/<filename>', 'uploaded_file', build_only=True)
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
    '/uploads': app.config['UPLOAD_FOLDER']
})

if __name__ == '__main__':
    app.run(debug=True)